﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using University.Workshop.Business;
using University.Workshop.DataAccess;
using University.Workshop.Model;
using System.Collections.ObjectModel;
using System.Threading;
using System.Globalization;
using University.Workshop.DataAccess.LanguagePack.ClientLanguagePack;

namespace University.Workshop.ClientApp
{
    /// <summary>
    /// Interaction logic for LevelRules.xaml
    /// </summary>
    public partial class LevelRules : Window
    {
        Client player;
        Collection<LevelDatabase> Levels;
        public LevelRules(string language)
        {
            InitializeComponent();
            Thread.CurrentThread.CurrentUICulture = new CultureInfo(language);
            ApplyLanguage();
            player = new Client();
            Levels = new Collection<LevelDatabase>();
            Levels=player.GetAllLevels;
            if (Levels != null)
            {
                labelTimeWon2.Content = Levels[0].TimeWon;
                labelTimeWon3.Content = Levels[1].TimeWon;
                labelTimeWon4.Content = Levels[2].TimeWon;
                labelTimeWon5.Content = Levels[3].TimeWon;
                labelTimeWon6.Content = Levels[4].TimeWon;
                labelChips2.Content = Levels[0].Chips;
                labelChips3.Content = Levels[1].Chips;
                labelChips4.Content = Levels[2].Chips;
                labelChips5.Content = Levels[3].Chips;
                labelChips6.Content = Levels[4].Chips;
            }
            
        }

        private void ApplyLanguage()
        {
            label1.Content = ClientLanguagePack.LevelRulesLabelLevels;
            label2.Content = ClientLanguagePack.LevelRulesLabel2Chips;
            label3.Content = ClientLanguagePack.LevelRulesLabel3HandsWon;
        }
    }
}
